package com.gljr.exam.dao;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.gljr.exam.domain.UploadExam;

public interface ExamResultRepository extends PagingAndSortingRepository<UploadExam, Long> {
	@Query("SELECT SUM(result) FROM UploadExam u WHERE u.userexamnb = ?1")
	Long findResultByUserexamnb(Long userexamnb);

	@Query(value = "select max(id) FROM upload_exam", nativeQuery = true)
	UploadExam findMaxID();

}
